package com.eudon.design_pattern.structural.facade.system_a;

/**
 * @author eudon
 * @description 采用门面模式设计的创建用户和钱包接口
 * @date 2025/9/2
 * @email syd19970616@gmail.com
 * @address <a href="https://gitee.com/eudon">Gitee</a>
 */
public class UserAndWalletService {
    private final UserService userService;
    private final WalletService walletService;

    public UserAndWalletService(UserService userService, WalletService walletService) {
        this.userService = userService;
        this.walletService = walletService;
    }

    public boolean createUserAndWallet(String username, String password) {
        //1.创建用户逻辑
        Long userId = userService.createUser(username, password);

        //2.创建用户钱包逻辑
        return walletService.createUserWallet(userId);

    }
}
